package com.dy.controller;


import com.dy.domain.Lei;
import com.dy.domain.pojo.PageBean;
import com.dy.domain.pojo.Result;
import com.dy.service.LeiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.List;

@RestController
@RequestMapping("/lei")
public class LeiController {

    @Autowired
    private LeiService leiService;

    @RequestMapping("/findPage")
    public Result findPage(Integer pageNo,Integer pageSize,String ming){
        PageBean<Lei> pageBean = leiService.findPage(pageNo,pageSize,ming);

        return new Result().ok(pageBean);
    }


    //查所有
    @RequestMapping("/findall")
    public Result findall() throws IOException {

        List<Lei> list = leiService.findall();

        return new Result().ok(list);
    }




}
